import request from "@/plugins/axios";
// 合同列表
export function listApi(data) {
  return request({
    url: "/crm/contract/index",
    method: "post",
    data,
  });
}
//  合同详情
export function detailApi(id) {
  return request({
    url: `/crm/contract/read?id=${id}`,
  });
}
//  新增
export function addApi(data) {
  return request({
    url: "/crm/contract/create",
    method: "post",
    data,
  });
}
//  操作记录
export function logsApi(data) {
  return request({
    url: "/crm/contract/logs",
    method: "post",
    data,
  });
}
// 删除
export function delApi(data) {
  return request({
    url: "/crm/contract/delete",
    method: "post",
    data,
  });
}
// 合同数据选项
export function optionsApi(data) {
  return request({
    url: "/crm/contract/options",
    method: "post",
    data,
  });
}
// 修改合同基本信息
export function baseApi(data) {
  return request({
    url: "/crm/contract/save",
    method: "post",
    data,
  });
}
// 修改合同配送信息
export function saveAddrApi(data) {
  return request({
    url: "/crm/contract/saveAddr",
    method: "post",
    data,
  });
}
//添加合同商品项
export function addGoodsApi(data) {
  return request({
    url: "/crm/contract/addGoods",
    method: "post",
    data,
  });
}
//删除合同商品项
export function delGoodsApi(id) {
  return request({
    url: "/crm/contract/delGoods",
    method: "get",
    params: {
      id: id,
    },
  });
}
// 全部合同列表
export function all_listApi(data) {
  return request({
    url: "/crm/contract/list",
    method: "post",
    data,
  });
}
// 合同导出
export function exportApi(data) {
  return request({
    url: "/crm/export/orders",
    method: "post",
    data,
    responseType: "blob",
  });
}
